<template>
  <div class="ProdRecom">
    <div class="conrent" v-for="item in list" :key="item.pid">
      <div class="tit">
        <div class="titLeft">
          <h3>星期天沙发+画板茶几+向晚地灯</h3>
          <p>
            ￥
            <span>{{item.pprice}}</span>起
          </p>
        </div>
        <div class="divRight">
          <van-button color="#000" size="small">加入购物车</van-button>
        </div>
      </div>

      <div class="box">
        <div class="box_con" v-for="item in list" :key="item.pid">
          <img :src="item.pimg" alt />
          <h3>{{item.pname}}</h3>
          <b>
            ￥{{item.pprice}}
            <span>起</span>
          </b>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import * as api from "@/api/getProlist.js";
export default {
  name: "ProdGroup",
  data() {
    return {
      list: [],
      active: 0
    };
  },
  mounted() {
    api.getProdNameDel({ pname: "沙" }).then(data => {
      this.list = data.data.result;
      console.log(this.list);
    });
  }
};
</script>

<style scoped>
.conrent {
  width: 95%;
  margin: 10px auto;
  border: 1px solid #ccc;
}
.conrent:last-child {
  margin-bottom: 80px;
}
.tit {
  width: 100%;
  height: 100px;
  background: #efefef;
  overflow: hidden;
}

.tit .titLeft {
  float: left;
  padding: 20px;
  height: 90px;
}
.tit .titLeft h3,
.tit .titLeft p {
  margin: 0;
  padding: 0;
}
.tit .titLeft p {
  color: red;
}
.tit .divRight {
  float: right;
  margin: 20px 10px;
}
.box {
  height: 500px;
}
.box_con {
  width: 30%;
  float: left;
  margin: 10px;
  text-align: center;
  overflow: hidden;
}
.box_con img {
  width: 100%;
  height: 300px;
}
</style>